<?php							
		class CAttmapping extends database
		{
			var $table = 'cdb_attmapping';
			
			
		
			
			public function CAttmappingList ()
			{
				$sql = 'select * from {$this->table} '	;
				$this->setQuery($sql);
				$this->query();
				$arrTemp =  $this->loadAllRow();
				
	
				return $arrTemp; 
			}
			
			public function CAttmappingDetail ($id)
			{
				$sql="select * from $this->table where id='{$id}'";
				$this->setQuery($sql);
				$this->query();
				$arr=$this->loadAllRow();
				
				return $arr[0];
			}
			
			
			
			public function CAttmappingAdd ($id,$id_attribute,$id_type)
			{
				$sql = "INSERT INTO {$this->table} (`id`,`id_attribute`,`id_type`)
	VALUES ('{$id}','{$id_attribute}','{$id_type}');";
				
				$this->setQuery($sql);
				$this->query();	
				
				
			}
			
			public function CAttmappingUpdate ($id,$id_attribute,$id_type)
			{
				$sql = "update $this->table set id ='{$id}',id_attribute ='{$id_attribute}',id_type ='{$id_type}' where id = '{$id}' ";
			
				$this->setQuery($sql);
				$this->query();
			}
			
			public function CAttmappingDelete($id)
			{
				$sql="Delete from  $this->table where id='{$id}'";
				$this->setQuery($sql);
				$this->query();
			}
			
		}
	
	
	
	?>